package org.learn.test;

public class RecursionExercise {
    public static void main(String[] args) {
        //斐波拉契数
    A a1 =new A();
    int n = a1.fijian(4);
    System.out.println("第n个数是=" + n);
    }
}
class A{
    public int fijian(int n){
        if(n == 1 || n == 2 ){
            return 1;
        }else{
        }
            return fijian(n -1) + fijian(n-2);
    }
}
